package com.service.roleimpl;
import com.dao.RoleMapper;
import com.model.Role;
import com.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
/**
 * 编写者：王懿宸
 * 编写时间：2019-5-29
 * 类模块描述：查询及相关增删改
 */
@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;
    @Override
    public Role selectByPrimaryKey(int rid) {
        System.out.println("输入的参数为："+rid);
        return roleMapper.selectByPrimaryKey(rid);
    }

    @Override
    public List<Role> getIsBegin() {
        System.out.println("执行角色类型SQL语句");
        return roleMapper.getIsBegin();
    }
//获取全部角色信息
    @Override
    public List<Role> getAll() {
        return roleMapper.getAll();
    }
//删除角色信息
    @Override
    public int delRole(Integer rid) {
        return roleMapper.delRole(rid);
    }
//新增角色信息
    @Override
    public int insertRole(Role rolemodel) {
        return roleMapper.insertRole(rolemodel);
    }

    @Override
    public int updateRole(Role rolemodel) {
        return roleMapper.updateRole(rolemodel);
    }
}
